﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Student
{
    class Student
    {
        public string FirstName { get; set; }
        public string SecondName { get; set; }
        public string LastName { get; set; }
        public string SSN { get; set; }
        public string PermanentAddress { get; set; }
        public string MobilePhone { get; set; }
        public string Email { get; set; }
        public string Course { get; set; }
        public string Specialty { get; set; }
        public string Faculty { get; set; }
        public string University { get; set; }


        public override string ToString()
        {
            string result = "Name: "+this.FirstName+" "+this.SecondName+" "+this.LastName+", \n ";
            result += "PermanentAddress: " + this.PermanentAddress + ", \n ";
            result += "SNN: "+this.SSN+", \n ";
            result += "MobilePhone: " + this.MobilePhone + ", \n ";
            result += "Course: " + this.Course + ", \n ";
            result += "Specialty: " + this.Specialty + ", \n ";
            result += "Faculty: " + this.Faculty + ", \n ";
            result += "University: " + this.University + ", \n ";
            return result;
        }

        public override bool Equals(object obj)
        {
            Student student = obj as Student;
            
            if (!this.FirstName.Equals(student.FirstName))
            {
                return false;
            }
            if (!this.SecondName.Equals(student.SecondName))
            {
                return false;
            }
            if (!this.LastName.Equals(student.LastName))
            {
                return false;
            }
            if (!this.PermanentAddress.Equals(student.PermanentAddress))
            {
                return false;
            }
            if (!this.SSN.Equals(student.SSN))
            {
                return false;
            }
            if (!this.MobilePhone.Equals(student.MobilePhone))
            {
                return false;
            }
            if (!this.Course.Equals(student.Course))
            {
                return false;
            }
            if (!this.Email.Equals(student.Email))
            {
                return false;
            }
            if (!this.Specialty.Equals(student.Specialty))
            {
                return false;
            }
            if (!this.Faculty.Equals(student.Faculty))
            {
                return false;
            }
            if (!this.University.Equals(student.University))
            {
                return false;
            }

            return true;
        }

        public static bool operator ==(Student first, Student second)
        {
            return first.Equals(second);
        }

        public static bool operator !=(Student first, Student second)
        {
            return (!first.Equals(second));
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }
}
